home *** CD-ROM | disk | FTP | other *** search
- Path: news.eunet.fi!fipnet!kone!jsaarinen
- Newsgroups: comp.sys.amiga.programmer
- X-NewsReader: IntuiNews 1.2b (31.7.94)
- References: <38232459@kone.fipnet.fi> <4gbb5a$104@sunsystem5.informatik.tu-muenchen.de> <312990E8.5622@si.hhs.nl>
- From: "Jyrki Saarinen" <jsaarinen@kone.fipnet.fi>
- Date: Thu, 22 Feb 96 18:15:25 UT
- Comments: Illegal date header - new date added by quicknews
- X-Original-Date: Thu, 22 Feb 96 19:24:37
- MIME-Version: 1.0
- Content-Type: text/plain; charset=iso-8859-1
- Content-Transfer-Encoding: binary
- Subject: Re: TMapping again!
- Message-ID: <38232606@kone.fipnet.fi>
-
-
- > Alas, there is only one solution: use an extra register. Here is my
- > version, (in which I choose to use a4) _with_ pipe-line optimalization:
- >
- > move.w d1,d2 ; Set y-position texture (fixed-point 16.8)
- > addx.l d4,d1 ; ..and increase.
- > move.b d0,d2 ; Set x-position texture (fixed-point 16.16)
- > addx.l d3,d0 ; ..and increase.
- > move.w d2,a0 ; Create texture-pointer.
- > move.l a2,d2 ; Get shading-table pointer (fixed-point adres).
- >
- > ; only stall happens here (another write to d2):
- > move.b (a0),d2 ; Get texel; use as index into shading table.
- > adda.l a3,a2 ; Increase shading pointer (fixed-point adres).
- > move.l d2,a4 ; Create shading-pointer.
- > move.b (a4),(a1)+ ; Write shaded texel to screen.
-
- At least on the 68040 is it very important to have a instruction
- between
- move.l d2,a4
- move.b (a4),(a1)+
-
- I got a ~20% speed increase when I pipelined the loop
- like this:
-
- poly REPT 16
- move.w d3,d0
- move.w a1,d1
- move.b d4,d0
- addx.l d5,d3
- move.l d0,a3
- addx.l d6,d4
- move.b (a3),d1
- Here is the only stall
- move.l d1,a3
- add.l a2,a1
- move.b (a3),(a0)+
- ENDR
-
- Strangely enough, a different kind of scheduled loop
- delivered the best results on a 68060!
-
- > move.w d1,d2 ; Set y-position texture.
- > addx.l d4,d1 ; Increase y-position.
- > move.b d0,d2 ; Set x-position texture.
- > move.l a2,d5 ; Create a copy of the shading-table pointer.
- > addx.l d3,d0 ; Increase x-position.
- > move.b (d2),d5 ; Get texel; use as index into shading table.
- > adda.l a3,a2 ; Increase shading pointer.
- > move.b (d5),(a1)+ ; Write shaded texel to screen.
- >
- > ...shorter program (instruction _and_ byte-wise), faster execution,
- > less register-usage, no pipe-line stalls...
- > (Note the "(dX)", this one should execute just as fast as an "(aX)",
- > right?)
-
- Have you actually tested..? ;) (dn) is VERY slow.
-
- > F E E D B A C K ! :)
-
- You got it..
-
- -- _
- a Stellar programmer _ //
- "Amiga - back for the future" \X/
-